package com.example.Laboratory.Mapper;

import com.example.Laboratory.Entity.Friendship;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FriendshipMapper {
    //增加友情链接
    @Insert("INSERT INTO friendship ( friendship_name, friendship_link)" +
            "VALUES(#{friendship_name},#{friendship_link})")
    int addFriendship (Friendship t);

    //查找友情链接
    @Select("SELECT * FROM friendship ")
    List<Friendship> selectFriendship ( );

    //删除友情链接
    @Delete("DELETE FROM friendship WHERE friendship_id=#{friendship_id}")
    int deleteFriendship (int friendship_id);

    //修改友情链接
    @Update("UPDATE friendship SET  friendship_name=#{friendship_name}, " +
            "friendship_link=#{friendship_link} WHERE friendship_id=#{friendship_id}")
    int updateFriendship (Friendship i);

}
